<?php
/**
 * Created by PhpStorm.
 * User: cape
 * Date: 2017/11/14
 * Time: 9:29
 */


header('content-type:text/html;charset=utf-8');


function study(){
    echo 'stydying...<br/>';
}


function play(){
    echo 'play.....<br/>';
}


function sing(){
    echo 'sing....<br/>';
}


function doWhta($funcname){
    echo '我正在';
    $funcname();
    echo '<br/>';
}


doWhta('study');
doWhta('sing');
doWhta('play');


echo '<br/>';
$array = array(1,2,3,4,5);
function test1($var){
    return $var * 2;
}


$res = array_map('test1', $array);
var_dump($res);
echo '<hr/>';
$array = array(1,2,3,4,5,6,7,8,9);
function test2(&$var){
    $var*=3;
    return $var;
}

var_dump(array_walk($array, 'test2'));
echo '<br/>';
var_dump($array);

















